from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as DjangoUserAdmin

from .models import User


@admin.register(User)
class UserAdmin(DjangoUserAdmin):
    fieldsets = DjangoUserAdmin.fieldsets + (
        ("Role Information", {"fields": ("role", "assigned_teacher")}),
    )
    add_fieldsets = DjangoUserAdmin.add_fieldsets + (
        (
            "Role Information",
            {"classes": ("wide",), "fields": ("role", "assigned_teacher")},
        ),
    )
    list_display = DjangoUserAdmin.list_display + ("role", "assigned_teacher")
    list_filter = DjangoUserAdmin.list_filter + ("role",)
